package A;

public class Test_06 {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i <= 100; i++) {
            String s = i + "";
            if (!s.contains("9") && count != 5) {
                System.out.print(s+" ");
                count++;
            } else if (!s.contains("9")) {
                System.out.println(s);
                count = 1;
            }
        }
    }
}
